﻿using AutoMapper;
using BCDto.Trading.Purchase.GoodsPurchase;
using BCDto.Trading.Purchase.GoodsPurchaseCertificate;
using BCDto.Trading.Purchase.GoodsPurchaseChecklist;
using BCDto.Trading.Purchase.GoodsPurchaseContractAttachment;
using BCDto.Trading.Purchase.GoodsPurchaseItem;
using BCDto.Trading.Purchase.GoodsPurchasePaidRecord;
using BCEntity.Trading.Purchase.GoodsPurchase;
using BCEntity.Trading.Purchase.GoodsPurchaseCertificate;
using BCEntity.Trading.Purchase.GoodsPurchaseChecklist;
using BCEntity.Trading.Purchase.GoodsPurchaseContractAttachment;
using BCEntity.Trading.Purchase.GoodsPurchaseItem;
using BCEntity.Trading.Purchase.GoodsPurchasePaidRecord;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.MapperProfiles.Trading.Purchase
{
    public class PurchaseProfile : Profile
    {
        public PurchaseProfile()
        {

            //商品采购项
            CreateMap<GoodsPurchaseItemDto, GoodsPurchaseItemEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseItemRequestDto, GoodsPurchaseItemPutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseItemRequestDto, GoodsPurchaseItemEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseItemPutDto, GoodsPurchaseItemEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseItemEntity, GoodsPurchaseItemDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();

            //商品采购单
            CreateMap<GoodsPurchaseDto, GoodsPurchaseEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseRequestDto, GoodsPurchasePutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseRequestDto, GoodsPurchaseEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseDepositePaymentRequestDto, GoodsPurchaseEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseLastPaymentRequestDto, GoodsPurchaseEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseDeliveryInfoRequestDto, GoodsPurchaseEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseAllRequestDto, GoodsPurchaseEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchasePutDto, GoodsPurchaseEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseEntity, GoodsPurchaseDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            
            //商品采购清单
            CreateMap<GoodsPurchaseChecklistDto, GoodsPurchaseChecklistEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseChecklistRequestDto, GoodsPurchaseChecklistPutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseChecklistRequestDto, GoodsPurchaseChecklistEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseChecklistAppendDto, GoodsPurchaseChecklistEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseChecklistPutDto, GoodsPurchaseChecklistEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseChecklistEntity, GoodsPurchaseChecklistDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();

            //商品采购支付记录
            CreateMap<GoodsPurchasePaidRecordDto, GoodsPurchasePaidRecordEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchasePaidRecordRequestDto, GoodsPurchasePaidRecordPutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchasePaidRecordRequestDto, GoodsPurchasePaidRecordEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchasePaidRecordPutDto, GoodsPurchasePaidRecordEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchasePaidRecordEntity, GoodsPurchasePaidRecordDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();

            //商品采购合同附件
            CreateMap<GoodsPurchaseContractAttachmentDto, GoodsPurchaseContractAttachmentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseContractAttachmentRequestDto, GoodsPurchaseContractAttachmentPutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseContractAttachmentRequestDto, GoodsPurchaseContractAttachmentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseContractAttachmentPutDto, GoodsPurchaseContractAttachmentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseContractAttachmentEntity, GoodsPurchaseContractAttachmentDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();

            //商品采购单记账凭证
            CreateMap<GoodsPurchaseCertificateDto, GoodsPurchaseCertificateEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseCertificateRequestDto, GoodsPurchaseCertificatePutDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseCertificateRequestDto, GoodsPurchaseCertificateEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseCertificatePutDto, GoodsPurchaseCertificateEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<GoodsPurchaseCertificateEntity, GoodsPurchaseCertificateDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
        }
    }
}
